package org.yatr.ttcn.rt.impl;

import org.etsi.ttcn.tci.QualifiedName;
import org.etsi.ttcn.tci.TciModuleId;
import org.etsi.ttcn.tci.TciTypeClass;
import org.etsi.ttcn.tci.Type;
import org.etsi.ttcn.tci.Value;

public abstract class ComponentType implements Type {

	private static final long serialVersionUID = -7048709167693271167L;
	//private String name;
	private TciModuleId definingModule;
	private QualifiedName qn;
	
	protected ComponentType(String moduleName, String baseName){
		this.qn = TypeFactory.newQualifiedName(moduleName, baseName);
		this.definingModule = TypeFactory.newTciModuleId(moduleName, moduleName);
	}

	public TciModuleId getDefiningModule() {
		return definingModule;
	}

	public String getName() {
		return qn.getBaseName();
	}

	final public int getTypeClass() {
		return TciTypeClass.COMPONENT;
	}
	
	public QualifiedName getQualifiedName(){
		return qn;
	}
	
	final public String getTypeEncoding() {
		// do nothing for component type
		throw new RuntimeException("Component type have no getTypeEncoding");
	}

	final public String getTypeEncodingVariant() {
		// do nothing for component type
		throw new RuntimeException("Component type have no getTypeEncodingVariant");
	}
}
